//package com.hibase.demo.component;
//
//import com.hibase.core.emqx.annotation.HibaseMqttPayload;
//import com.hibase.core.emqx.annotation.HibaseMqttSubscribe;
//import lombok.extern.slf4j.Slf4j;
//import org.eclipse.paho.client.mqttv3.MqttMessage;
//import org.springframework.stereotype.Component;
//
//import java.nio.charset.StandardCharsets;
//
//@Slf4j
//@Component
//public class MqttMessageHandler {
//
//    /**
//     * topic = test/+
//     */
//    @HibaseMqttSubscribe("test/+")
//    public void sub(String topic, MqttMessage message, @HibaseMqttPayload String payload) {
//        log.info("receive from    : {}", topic);
//        log.info("message payload : {}", new String(message.getPayload(), StandardCharsets.UTF_8));
//        log.info("string payload  : {}", payload);
//    }
//
//    /**
//     * clientId = multi_client_1
//     * topic = test/+
//     */
////    @HibaseMqttSubscribe(value = "test/+", clients = "multi_client_1")
////    public void sub(String topic, MqttMessage message, @HibaseMqttPayload String payload) {
////        log.info("receive from    : {}", topic);
////        log.info("message payload : {}", new String(message.getPayload(), StandardCharsets.UTF_8));
////        log.info("string payload  : {}", payload);
////    }
//
//    /**
//     * subscribe = $queue/test/+
//     * topic = test/+
//     * pattern = ^test/([^/]+)$
//     */
////    @HibaseMqttSubscribe(value="test/{id}", shared=true)
////    public void sub(String topic, @HibaseMqttValue("id") String id, @HibaseMqttPayload User userInfo) {
////        log.info("receive from   : {}", topic);
////        log.info("named value id : {}", id);
////        log.info("object payload : {}", userInfo);
////    }
//
//    /**
//     * subscribe = $share/gp/test/+
//     * topic = test/+
//     * pattern = ^test/([^/]+)$
//     */
////    @HibaseMqttSubscribe(value="test/{id}", shared=true, groups="gp")
////    public void sub(String topic, @HibaseMqttValue("id") String id, @HibaseMqttPayload User userInfo) {
////        log.info("receive from   : {}", topic);
////        log.info("named value id : {}", id);
////        log.info("object payload : {}", userInfo);
////    }
//}
